package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * RoleId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class RoleId implements java.io.Serializable {

	// Fields

	private Integer roleid;
	private Integer userole;
	private Integer corpId;
	private Integer state;

	// Constructors

	/** default constructor */
	public RoleId() {
	}

	/** full constructor */
	public RoleId(Integer roleid, Integer userole, Integer corpId, Integer state) {
		this.roleid = roleid;
		this.userole = userole;
		this.corpId = corpId;
		this.state = state;
	}

	// Property accessors

	@Column(name = "roleid")
	public Integer getRoleid() {
		return this.roleid;
	}

	public void setRoleid(Integer roleid) {
		this.roleid = roleid;
	}

	@Column(name = "userole")
	public Integer getUserole() {
		return this.userole;
	}

	public void setUserole(Integer userole) {
		this.userole = userole;
	}

	@Column(name = "corp_id")
	public Integer getCorpId() {
		return this.corpId;
	}

	public void setCorpId(Integer corpId) {
		this.corpId = corpId;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof RoleId))
			return false;
		RoleId castOther = (RoleId) other;

		return ((this.getRoleid() == castOther.getRoleid()) || (this
				.getRoleid() != null && castOther.getRoleid() != null && this
				.getRoleid().equals(castOther.getRoleid())))
				&& ((this.getUserole() == castOther.getUserole()) || (this
						.getUserole() != null && castOther.getUserole() != null && this
						.getUserole().equals(castOther.getUserole())))
				&& ((this.getCorpId() == castOther.getCorpId()) || (this
						.getCorpId() != null && castOther.getCorpId() != null && this
						.getCorpId().equals(castOther.getCorpId())))
				&& ((this.getState() == castOther.getState()) || (this
						.getState() != null && castOther.getState() != null && this
						.getState().equals(castOther.getState())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getRoleid() == null ? 0 : this.getRoleid().hashCode());
		result = 37 * result
				+ (getUserole() == null ? 0 : this.getUserole().hashCode());
		result = 37 * result
				+ (getCorpId() == null ? 0 : this.getCorpId().hashCode());
		result = 37 * result
				+ (getState() == null ? 0 : this.getState().hashCode());
		return result;
	}

}